Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sonic-package-manager] support sonic-cli-gen and packages with YANG model #1650

Merged
merged 223 commits into from
Nov 24, 2021

Conversation

stepanblyschak
Copy link
Contributor

@stepanblyschak stepanblyschak commented Jun 2, 2021

NOTE: DEPENDS ON #1644

What I did

This PR brings in support for packages with YANG models and CLI auto generation capabilities for 3rd party packages.

How I did it

Packages can set two new flags in manifest - "auto-generate-show" and "auto-generate-config" in addition to YANG module recorded in package image label "com.azure.sonic.yang-module".

How to verify it

Build and run. Prepare some package with YANG model and test CLI is generated for it.

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

stepanblyschak and others added 30 commits November 3, 2020 15:56
Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
…packages-migration

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Co-authored-by: Joe LeVeque <jleveque@users.noreply.github.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
@renukamanavalan
Copy link
Contributor

@praveen-li Could you please also review?

Copy link
Contributor

@renukamanavalan renukamanavalan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Just added few minor comments only.
We could merge upon approval by @praveen-li

config/config_mgmt.py Show resolved Hide resolved
@rlhui
Copy link
Contributor

rlhui commented Nov 16, 2021

@praveen-li , @renukamanavalan - do you approve this PR or anything pending? Thanks.

config/config_mgmt.py Show resolved Hide resolved
config/config_mgmt.py Outdated Show resolved Hide resolved
sonic_package_manager/main.py Show resolved Hide resolved
@lgtm-com
Copy link

lgtm-com bot commented Nov 17, 2021

This pull request introduces 1 alert when merging bf05d42 into e7535ae - view on LGTM.com

new alerts:

  • 1 for Insecure temporary file

Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
@renukamanavalan
Copy link
Contributor

@renukamanavalan - completed review -- good to merge
@praveen-li -- Waiting for Praveen's approval

Copy link
Contributor

@renukamanavalan renukamanavalan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting for Praveen's approval

Copy link

@praveen-li praveen-li left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explaining it to me in meeting. I specially reviewed changes in ConfigMgmt. LGTM overall.

module_name = self.get_module_name(yang_module_str)
module_path = os.path.join(YANG_DIR, '{}.yang'.format(module_name))
if os.path.exists(module_path):
raise Exception('{} already exists'.format(module_name))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

caller of add_module should be able to handle it gracefully.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The caller can catch the exception and handle it gracefully.

@liat-grozovik liat-grozovik merged commit f5e5a56 into sonic-net:master Nov 24, 2021
abdosi pushed a commit that referenced this pull request Dec 8, 2021
…model (#1650)

- What I did
This PR brings in support for packages with YANG models and CLI auto generation capabilities for 3rd party packages.

- How I did it
Packages can set two new flags in manifest - "auto-generate-show" and "auto-generate-config" in addition to YANG module recorded in package image label "com.azure.sonic.yang-module".

- How to verify it
Build and run. Prepare some package with YANG model and test CLI is generated for it.

Signed-off-by: Stepan Blyshchak <stepanb@nvidia.com>
Co-authored-by: Vadym Hlushko <vadymh@nvidia.com>
prgeor added a commit to prgeor/sonic-utilities that referenced this pull request Dec 16, 2021
prgeor added a commit that referenced this pull request Dec 17, 2021
stepanblyschak added a commit to stepanblyschak/sonic-utilities that referenced this pull request Dec 30, 2021
judyjoseph pushed a commit that referenced this pull request Jan 5, 2022
DavidZagury added a commit to DavidZagury/sonic-utilities that referenced this pull request Jan 12, 2022
liat-grozovik pushed a commit that referenced this pull request Jan 17, 2022
…kages with YANG model (#1650)" (#1972)" (#1994)

This reverts commit fe00bbf.

- What I did
Revert previous revert, since the proposed fix has been merged - sonic-net/sonic-buildimage#9587

- How I did it
Revert the revert.

- How to verify it
Run build an on the switch.
judyjoseph pushed a commit that referenced this pull request Jan 31, 2022
…kages with YANG model (#1650)" (#1972)" (#1994)

This reverts commit fe00bbf.

- What I did
Revert previous revert, since the proposed fix has been merged - sonic-net/sonic-buildimage#9587

- How I did it
Revert the revert.

- How to verify it
Run build an on the switch.
dbarashinvd pushed a commit to dbarashinvd/sonic-utilities that referenced this pull request Jul 11, 2022
…kages with YANG model (sonic-net#1650)" (sonic-net#1972)" (sonic-net#1994)

This reverts commit fe00bbf.

- What I did
Revert previous revert, since the proposed fix has been merged - sonic-net/sonic-buildimage#9587

- How I did it
Revert the revert.

- How to verify it
Run build an on the switch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants